<?php 
/* 
Proyecto: Sistema Victoria 2.0
Programador: Felipe Guerra
Año: 2015
Flores de tumbabiro ©
*/
require_once('../core/libreria.php');
require_once('../db/connect.php'); 


if($_POST['verify'] and $_POST['verify'] == 'verify'){

	$sql = sprintf("
	DELETE
	FROM agencia_carga
	WHERE AGE_CODIGO = %s
	",
	GetSQLValueString($_GET['id'], "AGE_CODIGO"));
	mysql_select_db($database_victoria, $victoria );
	mysql_query($sql, $victoria ) or die(mysql_error());

	$fileNom = $_GET['pn'].'List.php';
	if (isset($_SERVER['QUERY_STRING'])) {
		$fileNom .= (strpos($fileNom, '?')) ? "&" : "?";
		$fileNom .= $_SERVER['QUERY_STRING'];
	}
	header(sprintf("Location: %s", $fileNom));

}
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../css/list.css" /><!--Importante, siempre debe ir antes del css del menu vertical-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>


<!-- title -->
<?php require_once('../core/title.php'); ?> 

<!-- BANNER -->
<?php require_once('../core/banner.php'); ?> 

<!-- Menú superior -->
<?php require_once('../core/menuSuperior.php'); ?> 

</head>

<body <?php require_once('../core/BodyBackground.php'); ?>  >
<br><br><br>
<form action="" method="post" name="form" id="form" >
<table width="100%" border="0">
  <tr>
    <td width="15%" valign="top" >
		<!-- Menú Vertical -->
		<?php require_once('../core/menuVertical.php'); ?> 
    </td>
    <td width="85%" align="center" >
    <!----------------------------------------
    --------------------INICIO----------------
    ----------------------------------------->
    
<!--Estilos de la tabla utilizada para ver y ABC-->
<link rel="stylesheet" href="../css/tabla.css" />

<!--Javascript de la tabla utilizada para ABC-->
<script src="../js/tabla.js"></script>

<?php 
$filaMostrar = $_GET['id'];

//--------------------SELECT INICIO---------------------
mysql_select_db($database_victoria, $victoria );
$query_rsListar = "
SELECT
*
FROM agencia_carga
WHERE AGE_CODIGO = '$filaMostrar'
";
//--------------------SELECT FIN------------------------

$rsListar = mysql_query($query_rsListar, $victoria ) or die(mysql_error());
$row_rsListar = mysql_fetch_assoc($rsListar);

?>
<table width="80%" border="1" style="background-color:#FFFFFF" class="tabla_css" >
  <tr  id="tr_encabezado" >
    <td colspan="2" id="td_encabezado">
	    Eliminar registro	
    </td>
  </tr>
  <tr>
    <td width="20%" class="etiqueta" ><strong>Nombre: </strong></td>
    <td width="20%"><?php echo $row_rsListar['AGE_NOMBRE'];?></td>
  </tr>
  <tr>
    <td width="20%" class="etiqueta" ><strong>Direccion: </strong></td>
    <td width="20%"><?php echo $row_rsListar['AGE_DIRECCION'];?></td>
  </tr>
  <tr>
    <td width="20%" class="etiqueta" ><strong>Telefono fijo: </strong></td>
    <td width="20%"><?php echo $row_rsListar['AGE_TELEFONO_FIJO'];?></td>
  </tr>
  <tr>
    <td width="20%" class="etiqueta" ><strong>Telefono movil: </strong></td>
    <td width="20%"><?php echo $row_rsListar['AGE_TELEFONO_MOVIL'];?></td>
  </tr>
  <tr>
    <td width="20%" class="etiqueta" ><strong>Nombre contacto: </strong></td>
    <td width="20%"><?php echo $row_rsListar['AGE_NOMBRE_CONTACTO'];?></td>
  </tr>
  <tr>
    <td width="20%" class="etiqueta" ><strong>Pagina web: </strong></td>
    <td width="20%"><?php echo $row_rsListar['AGE_PAGINA_WEB'];?></td>
  </tr>
  <tr>
    <td width="20%" class="etiqueta" ><strong>Skype: </strong></td>
    <td width="20%"><?php echo $row_rsListar['AGE_SKYPE'];?></td>
  </tr>
  <tr>
    <td width="20%" class="etiqueta" ><strong>Correo electronico: </strong></td>
    <td width="20%"><?php echo $row_rsListar['AGE_CORREO_ELECTRONICO'];?></td>
  </tr>
  <tr>
    <td class="etiqueta" ><strong>Estado: </strong></td>
    <td><input disabled="disabled" type="checkbox" <?php echo ($row_rsListar['AGE_ESTADO'] == 1 ? 'checked="checked"' : '' );?> /></td>
    </tr>
  <tr>
  <tr>
    <td colspan="2" id="td_pie">
      <input id="" type="button" value="Eliminar"  class="btn btn-large"  onclick="validaRegistro($('#form'))"/>
      <a href="<?php echo $_GET['pn']?>List.php?ms=<?php echo $_GET['ms']?>" class="btn btn-large" >
        Regresar
        </a>        
      </td>
  </tr>
</table>

    <!----------------------------------------
    --------------------FIN-------------------
    ----------------------------------------->
    </td>
  </tr>
</table>
<input id="verify" name="verify" type="hidden" value="verify"></input>
<form>
</body>
</html>